#ifndef WAVE_GENERATOR_HPP_
#define WAVE_GENERATOR_HPP_

#include <windows.h>
#include <vector>
#include <fstream>
using namespace std;

struct WaveInfo {
  long m_chunkId;
  long m_chunkSize;
  long m_format;
  long m_subChunk1Id;
  long m_subChunk1Size;
  short m_audioFormat;
  short m_channels;
  long m_sampleRate;
  long m_byteRate;
  short m_blockAlign;
  short m_bitsPerSample;
  long m_subChunk2Id;
  long m_subChunk2Size;
};

class WaveGenerator
{
private:
  vector<short> m_samples;
  vector<char> m_data;
  WaveInfo m_info;  

public:
  void AddSample(short sample);
  void Clear();

  void GenerateData(long sampleRate);
  char* GetData();

protected:
  void FillWaveInfo(long sampleRate);
};

#endif